<template>
  <div>
    <h4>子组件</h4>
  </div>
</template>

<script>
export default {
  name: "Child",
  data() {
    return {
      count: 0,
    };
  },
  mounted() {
    // $parent可以获取到所有的父组件
    console.log(this.$parent, "parent");
    console.log(this.$root, "2");
  },
};
</script>

<style>
</style>